ngx.req.read_body()
        
local redis = require "resty.redis"
local red = redis.new()
red.connect(red, '127.0.0.1', '6379')
local res, err = red:auth("123456")
local myIP = ngx.req.get_headers()["X-Real-IP"]
if myIP == nil then
	myIP = ngx.req.get_headers()["x_forwarded_for"]
end
if myIP == nil then
	myIP = ngx.var.remote_addr
end

local args = ngx.req.get_post_args()
local data = ngx.req.get_body_data()
if data == nil then
	ngx.say("course:",args.course);
else


	ngx.say("course:",data.courseId);
end
	ngx.log(ngx.DEBUG, "args" .. args)
	ngx.log(ngx.DEBUG, "data" .. data)
close_redis(red)